# $Id: PKGBUILD 84599 2013-02-20 11:58:54Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Timm Preetz <timm@preetz.us>
# Contributor: Michael 'manveru' Fellinger <m.fellinger@gmail.com>
# Contributor: Dave Pretty <david dot pretty at gmail dot com>

pkgname=anki
pkgver=2.0.8
pkgrel=1
pkgdesc="Helps you remember facts (like words/phrases in a foreign language) efficiently"
url="http://ankisrs.net/"
license=('GPL')
arch=('any')
depends=('python2-pyqt' 'python2-sqlalchemy' 'python2-simplejson'
	 'python2-pysqlite' 'python2-beautifulsoup3')
makedepends=()
optdepends=('python2-matplotlib: show graphs'
	    'sox: audio recording'
	    'portaudio')
install=anki.install
source=(http://ankisrs.net/download/mirror/anki-$pkgver.tgz)
md5sums=('ee93fc1d1dce0d0b68431ec117d5f556')

build() {
  cd $srcdir/anki-$pkgver
  sed -i 's|#!/usr/bin/env python|#!/usr/bin/env python2|' runanki
  rm -f anki.bat
}

package() {
  cd $srcdir/anki-$pkgver
  mkdir -p $pkgdir/usr/{bin,share/{anki,pixmaps,applications,man/man1}}
  cp -av * $pkgdir/usr/share/anki/
  cd $pkgdir/usr/share/anki && (
    mv runanki ../../bin/anki
    mv anki.xpm anki.png ../pixmaps/
    mv anki.desktop ../applications/
    mv anki.1 ../man/man1/
  )
  rm -f $pkgdir/usr/share/anki/thirdparty/py*/_portaudio.so
}
